﻿using System;
using System.Windows.Data;
using System.Windows;

namespace RLProject1.ViewModel.Helper {
    /// <summary>
    /// Konvertiert bool zu Visibility
    /// </summary>
    [ValueConversion(typeof(bool), typeof(Visibility))]
    class BoolToVisibilityConverter : IValueConverter {

        #region IValueConverter Members

        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) {
            if ((bool)value)
                return Visibility.Visible;
            return Visibility.Hidden;
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) {
            return ((Visibility)value).Equals(Visibility.Visible);
        }

        #endregion
    }
}
